<?php


/*
 *  A Part of snock project
 *   Author king-of-war
 * Last modified 2009-4-20
 *
 */
 @session_start();

$root_path = '../'; //set the root path for this file

include_once $root_path . 'admin/smarty_config.php';
include_once $root_path . 'admin/class/cfg.class.php';
/*
 *
 * check identify
 */
include_once $root_path.'admin/class/verify.class.php';
$a=new verify($root_path);
$a->identity_check(3);

/*
 * init vars
 */
$cfg = new cfg($root_path);

$cfgs = $cfg->cfg_get();

$temps = $cfg->temp('templates');

/*
 * process
 */
$info = '网站信息配置';
if (isset ($_POST['submit'])) {
	$site_name = $_POST['site_name'];
	$meta_key = $_POST['meta_key'];
	$meta_des = $_POST['meta_des'];
	$url = $_POST['url'];
	$temp = $_POST['temp'];
	$gate = $_POST['gate'];
	$close = $_POST['close'];
	$close_info = $_POST['close_info'];
	$page_num = $_POST['page_num'];
	$guest = $_POST['guest'];
	$copyright = $_POST['copyright'];
$line=$cfg->cfg_updata($site_name,$meta_key,$meta_des,$url,$temp,$close,$close_info,$page_num,$guest,$copyright);
	if($line){
		$info="更新成功";
	}else{
		$info="更新成功";
	}

}

/*
 * set templates
 *
 */
$smarty->assign("info", $info);
$smarty->assign("cfg", $cfgs);
$smarty->assign("temps", $temps);
$smarty->display("sys_config.html");
?>
